package com.ccp.web.i18n;

import javax.servlet.http.HttpSession;

import org.apache.struts2.ServletActionContext;

import com.opensymphony.xwork2.ActionSupport;

@SuppressWarnings("serial")
public class ChangeCssSelector extends ActionSupport {

	private String selectCss;
	
	public String getSelectCss() {
		return selectCss;
	}

	public void setSelectCss(String selectCss) {
		this.selectCss = selectCss;
	}

	private String key;

	public String getKey() {
		return key;
	}

	public void setKey(String key) {
		this.key = key;
	}

	@Override
	public String execute() throws Exception {
		
		this.changeCssSelector(); 
		
		return "loginPage";
	}
	
	
	
	public String changeFrameLanguage() throws Exception {
		this.changeCssSelector(); 
		return "framePage";
	}
	
	private void changeCssSelector() {
		HttpSession session = ServletActionContext.getRequest().getSession();
		if (selectCss.equals("ui01.css")) {
			selectCss = "ui01.css";
		} else {
			selectCss = "ui02.css";
		}
		session.setAttribute("CURRCSS", selectCss);
	}
}
